package com.linux.huhx.thread;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * Created by huhx on 2017/5/26.
 */
public class ExecutorTest {
    public static void main(String[] args) {
        ScheduledExecutorService executorService = Executors.newScheduledThreadPool(3);
        executorService.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello world");
            }
        }, 1000, 1000, TimeUnit.MILLISECONDS);
        executorService.shutdown();
    }
}
